package com.hl.springboothome1.controller;


import com.hl.springboothome1.util.R;
import com.sun.org.glassfish.external.statistics.annotations.Reset;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName UserController
 * @Description TODO
 * @Author libowen
 * @Date 2025年03月03日 17:38
 * @Version 1.0
 */
@RestController
@RequestMapping("user")
@CrossOrigin
public class UserController {

    // get请求
    @GetMapping("getUser")  // localhost:8080/user/getUser?id=1
    public R getUser(int id){
        return R.ok("哈哈"+id);
    }

    @GetMapping("/{id}")  // localhost:8080/user/12
    public R getUser2(@PathVariable("id") int id){
        return R.ok("嘻嘻"+id);
    }

}
